<template>
	<view class="content authway-container">
		<view class="authway-title flexbox flexbox-middle">选择认证方式</view>
		<view class="way-list">
			<view @click="handleAuth" class="way-item flexbox flexbox-middle">
				<image class="way-icon" src="/static/images/authway_icon1.png"></image>
				<view class="flexchild">
					<view class="name f-32">我是法定代表人</view>
					<view class="dec f-24">无需提交其他材料，一键认证</view>
				</view>
				<image class="more-icon" src="/static/images/more_icon.png"></image>
			</view>
			
			<!-- <view class="way-item flexbox flexbox-middle">
				<image class="way-icon" src="/static/images/authway_icon2.png"></image>
				<view class="flexchild">
					<view class="name f-32">我是授权经办人</view>
					<view class="dec f-24">需准备企业对公账户信息或授权委托书</view>
				</view>
				<image class="more-icon" src="/static/images/more_icon.png"></image>
			</view> -->
		</view>
	</view>

</template>

<script>
	import { pushData } from '@/static/js/utils.js'
	export default {
		data() {
			return {
				param: {},
				scan_flag: ''
			}
		},
		onLoad: function(e) {
			this.param = e
			this.scan_flag = e.scan_flag || ''
			let ctid = e.ctid || ''
			if (ctid) {
				uni.setStorageSync('ctid', ctid);
			}
		},
		methods: {
			handleAuth() {
				this.$HTTP.post('/audit/companyLegal', this.param, true).then((res) => {
					pushData(this.scan_flag)
					setTimeout(() => {
						uni.reLaunch({
						    url: `/pages/companyAuthStatus/index?type=1`
						});
					}, 2000)
				}).catch(err => {
					setTimeout(() => {
						uni.reLaunch({
						    url: `/pages/companyAuthStatus/index?type=2&msg=${err.msg}`
						});
					}, 2000)
				})
			}
		}


	}
</script>

<style lang="scss" scoped>
	.authway-container {
		padding: 10rpx 40rpx;
	}
	.authway-title {
		height: 154rpx;
		font-size: 40rpx;
		font-weight: bold;
	}
	.way-item {
		height: 186rpx;
		padding: 0 40rpx;
		margin-bottom: 32rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		.way-icon {
			width: 90rpx;
			height: 90rpx;
			margin-right: 40rpx;
		}
		.dec {
			margin-top: 10rpx;
			color: #999999;
		}
		.more-icon {
			width: 36rpx;
			height: 36rpx;
			margin-left: 16rpx;
		}
	}
	
</style>
<style lang="scss">
	page{
		background-color: #f8f8f8;
	}
</style>